<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>总结管理</title>
<s:include value="/app_common/common.jsp"></s:include>
<!-- 日期选择框start -->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->
<!--数字分页start-->
<script type="text/javascript" src="<s:property value='webctx'/>/libs/js/nav/pageNumber.js"></script>
<!--数字分页end-->
<!-- 用户选择start -->
<script type="text/javascript" src="<s:property value='webctx'/>/app_common/userPopup/queryUser.js"></script>
<!-- 用户选择end -->
</head>
<body>
<form name="form1" id="form1" action="<s:property value='webctx'/>/summary/summary_querySummary.action" method="post">
<div class="box2" panelTitle="功能面板">
	<fieldset>
		<legend>查询</legend>
		<table class="noclass" style="width: 100%" >
			<tr>
				<td>总结编码：</td>
				<td><input type="text" name="summary.s_code" value="<s:property value='summary.s_code'/>"/></td>
				<td>总结名称：</td>
				<td><input type="text" name="summary.s_name" value="<s:property value='summary.s_name'/>"/></td>
							</tr>
			<tr>
				<td>总结类型:</td>
				<td><select name="summary.s_type" selectedValue="<s:property value='summary.s_type'/>" prompt="请选择" data='<s:property value="map.sel_14"/>'></select></td>
				<td>重要程度:</td>
				<td><select name="summary.s_levels" selectedValue="<s:property value='summary.s_levels'/>" prompt="请选择" data='<s:property value="map.sel_13"/>'></select></td>
			</tr>
			<!-- 权限 -->
			<s:if test="#session.u_power!=3">
			<tr>
				<s:if test="#session.u_power == 1 ||#session.u_power == 0">
					<td>所属部门:</td><td>
						<select name="summary.s_submit_dpcode" id="query_dp_code" selectedvalue="<s:property value='summary.s_submit_dpcode'/>" prompt="请选择" url='<s:property value="webctx"/>/dp/dp_getJsonDpCode.action'></select></td>
					<td>提交人:</td>
					<td>
						<s:hidden name="summary.s_submit_ucode" id="user_code"></s:hidden>
						<input type="text" id="user_name" name="summary.s_submit_uname" style="cursor: pointer;" onclick="queryUserAll()" readonly="readonly" class="query_user" value="<s:property value='summary.s_submit_uname'/>" />
					</td>			
				</s:if>
				<s:else>
					<td>提交人:</td>
					<td>
						<s:hidden name="summary.s_submit_ucode" id="user_code"></s:hidden>
						<s:hidden id="query_dp_id" value="%{#session.userltd}"></s:hidden>
						<input type="text" id="user_name" name="summary.s_submit_uname" style="cursor: pointer;" onclick="queryUserAll()" readonly="readonly" class="query_user" value="<s:property value='summary.s_submit_uname'/>" />
					</td>			
				</s:else>
			</tr>
			</s:if>
			<tr>
				<td colspan="4" align="center" >
					<button type="button" onclick="resets()"><span class="icon_reload">重置</span></button>&nbsp;
					<button type="button" onclick="search()"><span class="icon_find">查询</span></button>
				</td>
			</tr>
		</table>
	</fieldset>
</div>
<div class="box_tool_min padding_top2 padding_bottom2 padding_right5">
	<div class="center">
		<div class="left">
			<div class="right">
				<div class="padding_top5 padding_left10">
					<a href="javascript:;" onclick="onInsert()"><span class="icon_add">新增总结</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="onDelete(null)"><span class="icon_delete">批量删除</span></a>
					<!-- 
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="importSummary()"><span class="icon_import">导入</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;" onclick="exportSummary()"><span class="icon_export">导出当前页</span></a>
					<div class="box_tool_line"></div>
					<a href="javascript:;"  onclick="exportSummary2()"><span class="icon_export">导出全部</span></a> -->
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="scrollContent" class="border_gray">
<table class="tableStyle" thTrueWidth="true" useCheckBox="true" mode="list" fixedCellHeight="true">
		<tr>
			<th width="25"></th>
			<th>总结编号</th>
			<th>总结名称</th><!-- 
			<th>总结类别</th>
			<th>总结重要程度</th> -->
			<th>提交人编码</th>
			<th>提交人名称</th>
			<th>提交人时间</th>
			<th>部门编码</th>
			<th>部门名称</th>
			<th width="70">操作</th>
		</tr>
		<s:iterator value="page.result" status="stat">
		<tr ondblclick="onView(<s:property value="s_id"/>)">
			<td width="25"><input name="keys" type="checkbox" value="<s:property value="s_id"/>" /></td>
			<td><s:property value="s_code"/></td>
			<td><s:property value="s_name"/></td><%-- 
			<td><s:property value="s_type"/></td>
			<td><s:property value="s_levels"/></td> --%>
			<td><s:property value="s_submit_ucode"/></td>
			<td><s:property value="s_submit_uname"/></td>
			<td><s:property value="s_submit_date.length()>10?s_submit_date.substring(0,10):s_submit_date"/></td>
			<td><s:property value="s_submit_dpcode"/></td>
			<td><s:property value="s_submit_dpname"/></td>

			<td width="70">
				<span class="img_view hand" title="查看" onclick="onView(<s:property value="s_id"/>)"></span>
				<span class="img_edit hand" title="修改" onclick="onEdit(<s:property value="s_id"/>)"></span>
				<span class="img_delete hand" title="删除" onclick="onDelete(<s:property value="s_id"/>)"></span>
			</td>
		</tr>
		</s:iterator>
	</table>
</div>
<!-- 分页 -->
<div style="height:35px;">
	<div class="float_left padding5">共查询<s:property value='total'/>条数据</div>
	<div class="float_right padding5">
		<div class="pageNumber" total="<s:property value='total'/>" page="<s:property value='currentPage-1'/>" pageSize="<s:property value='size'/>" showSelect="true" showInput="true" id="page"></div>
	</div>
	<div class="clear"></div>
</div>
<s:hidden name="currentPage"/>
<s:hidden name="size"/>
</form>
</body>
<script type="text/javascript">
//分页事件
$("#page").bind("pageChange",function(e,index){
	$('#currentPage').val(index+1);
	showProgressBar();
	document.form1.submit();
}).bind("sizeChange",function(e,num){
	$('#size').val(num);
	showProgressBar();
	document.form1.submit();
});
//搜索
function search(){
	showProgressBar();
	document.form1.submit();
}
//重置
function resets(){
	$('.noclass input').val('');
	
	$('select').each(function(){
		$(this).children('option:eq(0)').attr('selected',true);
	});
}
//查看
function onView(obj){
	showProgressBar();
	window.location = webctx+"/summary/summary_findSummaryView.action?summary.s_id="+obj;
	//top.Dialog.open({URL:webctx+"/summary/summary_findSummaryView.action?summary.s_id="+obj,Title:"总结信息查看",Width:550,Height:400}); 
}
//新增
function onInsert(){
	showProgressBar();
	window.location = webctx+"/summary/summary_findSummaryDetil.action?summary.s_id=0";
	//top.Dialog.open({URL:webctx+"/summary/summary_findSummaryDetil.action?summary.s_id=0",Title:"总结信息新增",Width:550,Height:450});
}
//修改
function onEdit(obj){
	showProgressBar();
	window.location = webctx+"/summary/summary_findSummaryDetil.action?summary.s_id="+obj;
	//top.Dialog.open({URL:webctx+"/summary/summary_findSummaryDetil.action?summary.s_id="+obj,Title:"总结信息更新",Width:550,Height:450});
}
//删除
function onDelete(obj){
	top.Dialog.confirm("确定要删除该记录吗？",function(){
		var actionUrl;
		//单个删除
		var actionData = "rnd:"+Math.random();
		if(obj!=null){
			actionUrl = webctx+"/summary/summary_deleteSummaryById.action?keys="+obj;
		}else {
			if($('input[name="keys"]:checked').length==0){
				top.Dialog.alert("请选择需要删除的团队总结!");
				return false;
			}
			actionUrl = webctx+"/summary/summary_deleteSummaryById.action";
			actionData = $("#form1").serialize();
		}
		showProgressBar();
		$.ajax({
			url:actionUrl,
			data:actionData,
			type : "post",
			cache : false,
			dataType : 'text',
			success : function(data) {
				alert(data);
				closeProgress();
				if(data.indexOf('失败')!=-1)return false;
				document.form1.action = webctx+"/summary/summary_querySummary.action";
				document.form1.submit();
			}
		});
	});
}

</script>
</html>